package com.rmt.www.action;

import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.dao.TraceabilityDao;
import com.rmt.www.service.AdminManageTraceabilityService;
import com.rmt.www.vo.Traceability;
import com.rmt.www.vo.TraceabilityV2;


public class AddTraceAction extends ActionSupport{
	private int fromId;
	private int toId;
	private String fromtable;
	private String totable;
	private AdminManageTraceabilityService adminManageTraceabilityService;
	
	
	public AdminManageTraceabilityService getAdminManageTraceabilityService() {
		return adminManageTraceabilityService;
	}
	public void setAdminManageTraceabilityService(
			AdminManageTraceabilityService adminManageTraceabilityService) {
		this.adminManageTraceabilityService = adminManageTraceabilityService;
	}
	public String getFromtable() {
		return fromtable;
	}
	public void setFromtable(String fromtable) {
		this.fromtable = fromtable;
	}
	public String getTotable() {
		return totable;
	}
	public void setTotable(String totable) {
		this.totable = totable;
	}
	public int getFromId() {
		return fromId;
	}
	public void setFromId(int fromId) {
		this.fromId = fromId;
	}
	public int getToId() {
		return toId;
	}
	public void setToId(int toId) {
		this.toId = toId;
	}
	
	public void addTrace(){
		TraceabilityV2 t=new TraceabilityV2(null,fromtable,fromId,totable,toId);
		adminManageTraceabilityService.addTraceability(t);
	}
}
